import axios from '~/axios'

// 添加交易申请
export function addTradeApplicationApi(data) {
    return axios.post('/basic/lindi/tradeApplication/addTradeApplication', data)
}

// 删除交易申请
export function deleteTradeApplicationByTradeApplicationIdApi(tradeApplicationId) {
    return axios({
        method: 'DELETE',
        url: '/basic/lindi/tradeApplication/deleteTradeApplicationByTradeApplicationId',
        params: {
            tradeApplicationId: tradeApplicationId
        }
    })
}

// 修改交易申请
export function updateTradeApplicationByTradeApplicationIdApi(data) {
    return axios.put('/basic/lindi/tradeApplication/updateTradeApplicationByTradeApplicationId', data)
}

// 分页查询交易申请列表
export function getPageTradeApplicationListApi(params) {
    return axios({
        method: 'GET',
        url: '/basic/lindi/tradeApplication/getPageTradeApplicationList',
        params: params
    })
}

// 根据ID查询交易申请详情
export function getTradeApplicationByTradeApplicationIdApi(tradeApplicationId) {
    return axios.get(`/basic/lindi/tradeApplication/getTradeApplicationByTradeApplicationId/${tradeApplicationId}`)
}

export function agreeTradeApplicationApi(data) {
    return axios.post('/basic/lindi/tradeApplication/agreeTradeApplication', data)
}

export function approveTradeApplicationApi(data) {
    return axios.post('/basic/lindi/tradeApplication/approveTradeApplication', data)
}